@extends('layouts.app')
@section('content')
    <div class="container">
        
        <ul class="nav nav-tabs" id="myTab" role="tablist">
            <li class="nav-item">
              <a class="nav-link active" id="todo-tab" data-toggle="tab" href="#todo" role="tab" aria-controls="todo" aria-selected="true">待办事项</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" id="done-tab" data-toggle="tab" href="#done" role="tab" aria-controls="done" aria-selected="false">已完成事项</a>
            </li>
          
          </ul>
          <div class="tab-content" id="myTabContent">
              
                <div class="tab-pane fade show active" id="todo" role="tabpanel" aria-labelledby="todo-tab">
                    {{--  @each('tasks._todo', $todos, 'todo')  --}}
                   @if (count($todos))
                   @foreach ($todos as $todo)
                   <table class="table table-striped">
      
                      <tr>
                          <td class="col-9 pl-5">{{ $todo->name }}</td>
                          <td>@include('tasks._checkForm')</td>
                          <td>@include('tasks._editModel')</td>
                          <td>@include('tasks._deleteForm')</td>
                      </tr>
                     
                    </table>
                   @endforeach 
                   <div class="pull-right">
                    {{ $todos->links() }} 
                   </div>
                   @endif
                   
                </div>
                <div class="tab-pane fade" id="done" role="tabpanel" aria-labelledby="done-tab">
                        @each('tasks._done', $done, 'done')
                </div>
               
              </div>
    </div>
@endsection